package com.lsc.record.core.entity;

import java.util.List;

import com.lsc.record.core.listener.BaseEntityInsertListener;
import com.lsc.record.core.listener.BaseEntityUpdateListener;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.RelationOneToMany;
import com.mybatisflex.annotation.Table;

@Table(value="dm_folder",onInsert = BaseEntityInsertListener.class,onUpdate = BaseEntityUpdateListener.class)
public class DmFolder extends BaseEntity {
	
	public DmFolder() {
	}
	
	public DmFolder(String name) {
		this.setName(name);
	}
	
	public DmFolder(String name,String parentId) {
		this.setName(name);
		this.setParentId(parentId);
	}
	
	private String parentId;

	public String getParentId() {
		return parentId;
	}

	public void setParentId(String parentId) {
		this.parentId = parentId;
	}
	
	@Column(ignore = true)
	@RelationOneToMany(selfField = "id",targetField = "parentId",orderBy = "id")
	private List<DmFolder> items;

	public List<DmFolder> getItems() {
		return items;
	}

	public void setItems(List<DmFolder> items) {
		this.items = items;
	}
	
}
